﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp19
{
    class Program
    {
        static void Main(string[] args)
        {
            var connectionString = "server=.;uid=sa;pwd=123456;database=Admin";
            SqlConnection connection = new SqlConnection(connectionString);
            var sqlString = "select * from Student";
            DataTable dataTable = new DataTable();
            SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlString, connection);
            connection.Open();
            dataAdapter.Fill(dataTable);
            foreach(DataRow item in dataTable.Rows)
            {
                Console.WriteLine("{0}\t{1}\t{2}\t{3}",item[0],item[1],item[2],item[3]);
            }
        }
    }
}
